package com.robooot.business_counter.exception;


import com.robooot.business_counter.util.I18nUtil;

import java.util.Locale;

public enum DemoError {
    NO_PERMISSION,
    SYSTEM_ERROR,
    PHONE_ERROR,
    NOTIFY_RECEIVER,
    TITLE_CAINIAO,
    // error
    DEVICE_NOT_CONFIG,
    NOT_YOUR_PACKAGE,
    PACKAGE_LOCATION,

    // message
    DELIVER_MESSAGE,
    RECEIVER_MESSAGE,
    DELIVER_SUCCESS,
    RECEIVER_SUCCESS,
    TITLE_STORAGE,
    // message
    METRO_SUCCESS_IN,
    METRO_SUCCESS_OUT,
    METRO_WAITING_FACE,

    ;

    private int result;
    private String message;

    DemoError() {
        this.result = 183;
        this.message = this.name();
    }

    DemoError(String message) {
        this.result = 183;
        this.message = message;
    }

    public int getResult() {
        return result;
    }

    public void setResult(int result) {
        this.result = result;
    }

    public String getMessage() {
        return I18nUtil.getMessage(message);
    }

    public String getMessage(Locale locale) {
        return I18nUtil.getMessage(message, locale);
    }

    public String getMessage(Object... args) {
        return I18nUtil.getMessage(message, args);
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
